package com.oig.sys.workflow.controller;

import com.oig.sys.workflow.service.ITbListenerEventService;
import com.oig.sys.workflow.vo.ListenerEventVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 监听事件管理
 */
@Tag(name = "监听事件管理")
@RestController
@RequestMapping("/listenerEvent")
@Slf4j
@RequiredArgsConstructor
public class TbListenerEventController {

    private final ITbListenerEventService listenerEventService;


    @Operation(summary = "查看监听对像的监听事件列表,提供备选")
    @PostMapping("/listByObjId")
    public List<ListenerEventVo> findAllByObjectId(Integer objectId){
        log.info("find listener event by listener object id={}", objectId);
        return this.listenerEventService.findAllByObjectId(objectId);
    }


}
